package cn.wolfcode.p2p.business.service;

import cn.wolfcode.p2p.business.domain.BidRequest;
import cn.wolfcode.p2p.business.domain.PaymentSchedule;
import cn.wolfcode.p2p.business.query.PaymentScheduleQuery;
import com.github.pagehelper.PageInfo;

import java.util.List;

/**
 * 还款计划
 */
public interface IPaymentScheduleService {
    /**
     * 创建还款计划
     * @param br
     * @return
     */
    List<PaymentSchedule> createPaymentSchedule(BidRequest br);

    /**
     * 还款列表
     * @param qo
     * @return
     */
    PageInfo query(PaymentScheduleQuery qo);

    /**
     * 还款计划中的一个
     * @param id
     * @return
     */
    PaymentSchedule getById(Long id);

    /**
     * 更改还款计划
     * @param ps
     */
    void update(PaymentSchedule ps);

    /**
     * 已还清
     * @param bidRequestId
     * @param paymentStateDone
     * @return
     */
    int getReturnSuccessMonthIndexNumber(Long bidRequestId, int paymentStateDone);
}
